/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package EntityBeans;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 *
 * @author Keith Augustsson
 */
@Entity
@Table(name = "seatinstances")
@NamedQueries({@NamedQuery(name = "Seatinstances.findAll", query = "SELECT s FROM Seatinstances s"), @NamedQuery(name = "Seatinstances.findByNr", query = "SELECT s FROM Seatinstances s WHERE s.seatinstancesPK.nr = :nr"), @NamedQuery(name = "Seatinstances.findBySRow", query = "SELECT s FROM Seatinstances s WHERE s.seatinstancesPK.sRow = :sRow"), @NamedQuery(name = "Seatinstances.findByFlight", query = "SELECT s FROM Seatinstances s WHERE s.seatinstancesPK.flight = :flight"), @NamedQuery(name = "Seatinstances.findByEmpty", query = "SELECT s FROM Seatinstances s WHERE s.empty = :empty"), @NamedQuery(name = "Seatinstances.findByArrDate", query = "SELECT s FROM Seatinstances s WHERE s.arrDate = :arrDate"), @NamedQuery(name = "Seatinstances.findByDepDate", query = "SELECT s FROM Seatinstances s WHERE s.depDate = :depDate")})
public class Seatinstances implements Serializable {
    private static final long serialVersionUID = 1L;
    @EmbeddedId
    protected SeatinstancesPK seatinstancesPK;
    @Column(name = "empty")
    private Boolean empty;
    @Column(name = "arrDate")
    @Temporal(TemporalType.DATE)
    private Date arrDate;
    @Column(name = "depDate")
    @Temporal(TemporalType.DATE)
    private Date depDate;

    public Seatinstances() {
    }

    public Seatinstances(SeatinstancesPK seatinstancesPK) {
        this.seatinstancesPK = seatinstancesPK;
    }

    public Seatinstances(int nr, char sRow, String flight) {
        this.seatinstancesPK = new SeatinstancesPK(nr, sRow, flight);
    }

    public SeatinstancesPK getSeatinstancesPK() {
        return seatinstancesPK;
    }

    public void setSeatinstancesPK(SeatinstancesPK seatinstancesPK) {
        this.seatinstancesPK = seatinstancesPK;
    }

    public Boolean getEmpty() {
        return empty;
    }

    public void setEmpty(Boolean empty) {
        this.empty = empty;
    }

    public Date getArrDate() {
        return arrDate;
    }

    public void setArrDate(Date arrDate) {
        this.arrDate = arrDate;
    }

    public Date getDepDate() {
        return depDate;
    }

    public void setDepDate(Date depDate) {
        this.depDate = depDate;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (seatinstancesPK != null ? seatinstancesPK.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Seatinstances)) {
            return false;
        }
        Seatinstances other = (Seatinstances) object;
        if ((this.seatinstancesPK == null && other.seatinstancesPK != null) || (this.seatinstancesPK != null && !this.seatinstancesPK.equals(other.seatinstancesPK))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "EntityBeans.Seatinstances[seatinstancesPK=" + seatinstancesPK + "]";
    }

}
